package config;

import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class Connection {
    public WebDriver getDriver(){
        //启动谷歌浏览器
        WebDriverManager.chromedriver().setup();
        //增加浏览器配置，允许访问所有链接
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        //配置添加到驱动中
        WebDriver driver = new ChromeDriver(options);
        return driver;
    }

}
